package com.xyoto.community.mapper.comment;

import com.xyoto.community.entity.comment.QuestionComment;
import com.xyoto.community.po.MessageQuestionCommentPO;
import com.xyoto.community.po.QuestionCommentPO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 问答评论表mapper
 */
public interface QuestionCommentMapper {
    /**
     * 新增问答评论
     * @param questionComment
     * @return
     */
    Integer insertQuestionComment(QuestionComment questionComment);

    /**
     * 根据问答id分页查询问答评论列表
     *
     * @param questionId 问答id
     * @param endIndexId 上一页第一条记录的id
     *
     * @return Result<PageUtils<QuestionCommentsVo>>
     */
    List<QuestionCommentPO> getQuestionCommentsListById(
            @Param("questionId") Integer questionId,
            @Param("endIndexId") Integer endIndexId);

    /**
     * 根据id获取问答评论
     * @param questionCommentId  问答评论id
     * @return
     */
    QuestionComment getQuestionCommentById(Integer questionCommentId);

    Integer countQuestionComment(Integer endIndexId,Integer questionId ,Short deleteStatus);

    /**
     * 删除问答评论
     * @param questionComment 实体
     * @return
     */
    Integer removeQuestionComment(QuestionComment questionComment);

    /**
     * 获取问答评论列表
     * @param questionId 问答id
     * @return
     */
    List<Integer> getQuestionCommentList(Integer questionId);

    /**
     * 获取问答评论内容
     * @param moduleId  问答id
     * @return 问答内容
     */
    String getOneQuestionCommentContentByQuestionId(Integer moduleId);

    /**
     * 获取问答评论列表数据
     * @param questionCommentIds 问答 id集合
     * @return  问答列表
     */
    List<QuestionCommentPO> getQuestionCommentListByIds(List<Integer> questionCommentIds);

    /**
     * 获取问答评论
     * @param messageQuestionCommentIds 问答id集合
     * @return
     */
    List<MessageQuestionCommentPO> getQuestionCommentListContentByIds(List<Integer> messageQuestionCommentIds);
}
